{% extends "common/email.html" %}
{% block content %}
    <!-- 收件列表 -->
    <div id="receiveList" class="lookViewer"
         style="width: 100%; height: 96%; overflow: auto;">
        <table style="width: 100%; height: 100%;">
            <tr style="width: 100%; background: #a5d9f0;">
                <td style="height: 30px;">
                    <table style="width: 100%;">
                        <tr>
                            <td style="width: 30%;">
                                <a class="btn_gray btn_space"
                                   onclick="deleteCheckedRow()"
                                   href="javascript:void(0);">删除</a>
                                <a class="btn_gray btn_space" onclick="martAllToRead()"
                                   href="javascript:void(0);">全部标记为已读</a></td>
                            <td style="width: 70%; text-align: right;">
                                <div id="recv_page_info"
                                     style="width: 100%; height: 100%; margin-right: 20px; margin-top: 3px;"></div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td valign="top"
                    style="width: 100%; height: 100%; background: #fff;">
                    <table style="width: 100%;">
                        <tr style="background: #f2f4f6;">
                            <td width="15px"></td>
                            <td width="30px"><img
                                    src="{{ url_for('static',filename='oa/email/image/statelabel.gif') }}"/></td>
                            <td width="100px">发件人</td>
                            <td>主题</td>
                            <td width="100px">时间</td>
                        </tr>
                    </table>
                    <div id="receiveListData"
                         style="width: 100%; margin: 0; padding: 0;">
                        {% if count <1 %}
                            <div class="nomail"><b>没有邮件</b></div>
                        {% else %}
                            <div class="bd title"><a class="cur_default"><label><b></b>（<span
                                    class="underline">{{ count }}&nbsp;封</span>）</label></a></div>
                            {% for d in page_data.items %}
                                <table cellspacing="0" class="M" style="width: 100%;">
                                    <tr id="{{ d.fid }}" onclick="lookMail('{{ d.fid }}')"
                                        class="{% if d.fqurey != "已查看" %}ShowdatalistRowNoread{% else %}ShowdatalistRow{% endif %}">
                                        <td style="width:25px;">
                                            <input type="checkbox" row="{{ d.fid }}"
                                                   class="selectCheckBox"></td>
                                        <td style="width:30px;">
                                            {% if d.fqurey != "已查看" %}
                                                <img src="{{ url_for('static',filename='oa/email/image/weidu.gif') }}"
                                                     alt="未读邮件"/>
                                            {% else %}
                                                <img src="{{ url_for('static',filename='oa/email/image/yidu.gif') }}"
                                                     alt="已读邮件"/>
                                            {% endif %}
                                        </td>
                                        <td style="width:100px;">{{ d.fsendpername }}</td>
                                        <td class="showSenderTheme"
                                            title="{{ d.femailname }}">{{ d.femailname }}</td>
                                        <td style="width:150px">{{ d.fsendtime }}</td>
                                    </tr>
                                </table>
                            {% endfor %}
                        {% endif %}
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <script type="text/javascript">
        function loadSearchMail(text) {
            alert(text);
        }

        function deleteCheckedRow() {

        }

        function martAllToRead() {

        }

        function lookMail(id) {
            window.location.href = "/oa/email/lookEmail?id=" + id;
        }
    </script>
{% endblock %}